package com.canxi.earn.app;

import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.dev33.satoken.annotation.SaIgnore;
import com.canxi.common.annotation.Log;
import com.canxi.common.annotation.RepeatSubmit;
import com.canxi.common.core.controller.BaseController;
import com.canxi.common.core.domain.R;
import com.canxi.common.core.page.TableDataInfo;
import com.canxi.common.core.validate.AddGroup;
import com.canxi.common.core.validate.EditGroup;
import com.canxi.common.enums.BusinessType;
import com.canxi.common.utils.poi.ExcelUtil;
import com.canxi.earn.domain.bo.CxJokeBo;
import com.canxi.earn.domain.vo.CxJokeVo;
import com.canxi.earn.service.ICxJokeService;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import java.util.Arrays;
import java.util.List;

/**
 * 笑话
 *
 * @author ruoyi
 * @date 2024-09-05
 */
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/app/earn/joke")
public class CxAppJokeController extends BaseController {

    private final ICxJokeService iCxJokeService;


/**
     * 查询笑话列表
     */
@SaIgnore
    @GetMapping("/list")
@RepeatSubmit()
    public TableDataInfo<CxJokeVo> list(CxJokeBo bo) {
        return iCxJokeService.queryCxJokeList(bo);
    }


    /**
     * 随机获取笑话详细信息
     */
    @RepeatSubmit()
    @SaIgnore
    @GetMapping("/randomInfo")
    public R<CxJokeVo> getInfo() {
        return R.ok(iCxJokeService.queryRandomInfo());
    }


}
